package com.one.oa.vo;

import com.one.oa.constants.Rcode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {
    private int code;
    private String msg;
    private Object data;

    public static R ok(Object data){
        return new R(Rcode.OK,"操作成功",data);
    }
    public static R ok(){
        return ok(null);
    }
    public static R fail(String msg){
        return new R(Rcode.FAIL,msg,null);
    }
    public static R fail(){
        return fail("操作失败");
    }

}
